package com.demo242_有效的字母异位词;

import java.util.Arrays;

public class Solution {
    public static void main(String[] args) {
        boolean result = isAnagram("abc", "cba");
        System.out.println(result);
    }
    public static boolean isAnagram(String s, String t) {
        char[] chars = s.toCharArray();
        char[] chars1 = t.toCharArray();
        Arrays.sort(chars);
        Arrays.sort(chars1);
        s=new String(chars);
        t=new String(chars1);
        return s.equals(t);

    }
}
